diff --git a/init.lua b/init.lua
index 8921baa..799016c 100644
--- a/init.lua
+++ b/init.lua
@@ -89,6 +89,10 @@ subterrain = {}
 local yblmin = YMIN + BLEND * 1.5
 local yblmax = YMAX - BLEND * 1.5
 
+local nvals_cave = {}
+local nvals_wave = {}
+local nvals_biome = {}
+
 -- On generated function
 
 minetest.register_on_generated(function(minp, maxp, seed)
@@ -167,9 +171,9 @@ minetest.register_on_generated(function(minp, maxp, seed)
 	local minposxyz = {x=x0, y=y0, z=z0} --bottom corner
 	local minposxz = {x=x0, y=z0} --2D bottom corner
 
-	local nvals_cave = minetest.get_perlin_map(np_cave, chulens):get3dMap_flat(minposxyz) --cave noise for structure
-	local nvals_wave = minetest.get_perlin_map(np_wave, chulens):get3dMap_flat(minposxyz) --wavy structure of cavern ceilings and floors
-	local nvals_biome = minetest.get_perlin_map(np_biome, chulens2D):get2dMap_flat({x=x0+150, y=z0+50}) --2D noise for biomes (will be 3D humidity/temp later)
+	minetest.get_perlin_map(np_cave, chulens):get3dMap_flat(minposxyz, nvals_cave) --cave noise for structure
+	minetest.get_perlin_map(np_wave, chulens):get3dMap_flat(minposxyz, nvals_wave) --wavy structure of cavern ceilings and floors
+	minetest.get_perlin_map(np_biome, chulens2D):get2dMap_flat({x=x0+150, y=z0+50}, nvals_biome) --2D noise for biomes (will be 3D humidity/temp later)
 
 	local nixyz = 1 --3D node index
 	local nixz = 1 --2D node index
